/* 增强版样式 - Ultra版B站智能学习平台 */

:root {
    --primary-color: #00A1D6;
    --secondary-color: #FB7299;
    --accent-color: #4FC3F7;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --error-color: #F44336;
    --text-primary: #212121;
    --text-secondary: #757575;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-card: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.bilibili-logo {
    width: 60px;
    height: 60px;
    color: var(--secondary-color);
    animation: logo-glow 2s ease-in-out infinite alternate;
}

@keyframes logo-glow {
    from { filter: drop-shadow(0 0 5px rgba(251, 114, 153, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(251, 114, 153, 0.8)); }
}

.logo-text h1 {
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1em;
    font-weight: 500;
}

.header-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.95em;
}

.nav-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* 内容区域 */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    min-height: 600px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 输入区域 */
.input-section {
    margin-bottom: 40px;
}

.input-container {
    display: flex;
    gap: 15px;
    align-items: stretch;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1em;
}

.video-input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1em;
    transition: var(--transition);
    background: var(--bg-card);
}

.video-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 161, 214, 0.1);
}

.input-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.analyze-btn, .batch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1em;
    white-space: nowrap;
}

.analyze-btn:hover, .batch-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.analyze-btn:active, .batch-btn:active {
    transform: translateY(0);
}

.batch-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--warning-color));
}

.example-links {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.example-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.example-link {
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(0, 161, 214, 0.1);
    border-radius: 20px;
    transition: var(--transition);
    font-weight: 500;
}

.example-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5em;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 30px;
    border-top: 1px solid var(--border-color);
}

#batchInput {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1em;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
}

#batchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 161, 214, 0.1);
}

.batch-options {
    margin-top: 15px;
}

.batch-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
}

.btn-cancel, .btn-primary {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--border-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 推荐区域 */
.recommendations-section {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.05), rgba(0, 161, 214, 0.1));
    border-radius: var(--border-radius);
    border: 1px solid rgba(79, 195, 247, 0.2);
}

.recommendations-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.recommendation-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.recommendation-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.recommendation-info {
    padding: 15px;
}

.recommendation-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.recommendation-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.recommendation-stats {
    display: flex;
    gap: 10px;
}

.recommendation-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 系列课程分析 */
.series-analyzer, .learning-path-builder, .knowledge-map {
    max-width: 900px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 1em;
    transition: var(--transition);
    background: var(--bg-card);
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 161, 214, 0.1);
}

.create-btn, .build-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--success-color), #66BB6A);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 1.1em;
    margin: 20px 0;
}

.create-btn:hover, .build-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 学习统计面板 */
.learning-stats {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stats-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-item i {
    font-size: 2em;
    color: var(--primary-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 20px;
    }

    .logo-text h1 {
        font-size: 1.8em;
    }

    .header-nav {
        gap: 5px;
    }

    .nav-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .main-content {
        padding: 25px;
    }

    .input-container {
        flex-direction: column;
    }

    .input-wrapper {
        min-width: 100%;
    }

    .input-actions {
        justify-content: stretch;
    }

    .analyze-btn, .batch-btn {
        flex: 1;
        justify-content: center;
    }

    .stats-card {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .recommendation-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .stats-card {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 15px;
    }

    .logo {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .main-content {
        padding: 20px;
    }
}

/* 加载动画 */
.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    margin: 40px 0;
}

.bilibili-loading {
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-tv {
    width: 60px;
    height: 40px;
    background: var(--secondary-color);
    border-radius: 8px;
    position: relative;
    animation: tv-bounce 1.5s ease-in-out infinite;
}

.loading-wave {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 20px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 50%;
    animation: wave 1.5s ease-in-out infinite;
}

@keyframes tv-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes wave {
    0%, 100% { opacity: 0; transform: translateX(-50%) scaleX(0.5); }
    50% { opacity: 1; transform: translateX(-50%) scaleX(1); }
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
    min-width: 300px;
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.3s ease-out;
}

.toast.hidden {
    display: none;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

/* 工具类 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-secondary {
    color: var(--text-secondary);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}